from typing import List

from infirmary_admin_src.infirmary_common.infirmary_controller import IBaseController
from infirmary_admin_src.infirmary_common.infirmary_controller.rest_controller_with_depends import \
    RestControllerWithDepends
from fastapi import Request, Depends, Path, Body

from infirmary_admin_src.infirmary_smart_admin.infirmary_biz.infirmary.businesses.schemas import SchemaBase
from infirmary_admin_src.infirmary_smart_admin.infirmary_biz.system.employee.services import EmployeeBusinesses



class XParam(SchemaBase):
    '''
    账号密码登录参数
    '''
    employee_id_list: list[int]


class IController(IBaseController):
    '''
    定制相关约束检测函数逻辑步序
    '''

    def __init__(self, *, request: Request,
                 employee_id_list: List[int],
                 ):
        super().__init__(request=request)
        # 入参参数
        # 入参参数
        self.employee_id_list = employee_id_list


@RestControllerWithDepends()
class SystemEmployeeBatchDeleteController(IController):

    def business_login(self):
        pass
        # 查询用户信息，联表查询比较麻烦
        #  **{**self.schema_param.dict(exclude_unset=True, exclude={'is_trusted'}),
        # print('self.schema_param.employee_id_list',self.schema_param.employee_id_list)
        result = EmployeeBusinesses.edit_sys_employee_update_del_batch(employee_id_lists=self.employee_id_list,
        )
        if result:
            self.response_msg = '删除成功'
        else:
            self.response_ok = False
            self.response_msg = '删除失败'
            return None

        return None